﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CommandPattern : MonoBehaviour
{
    private GameObject slider { get; set; }
    private Invoker invoker { get; set; }

    private void Start()
    {
        slider = GameObject.Find("Slider");

        invoker = new Invoker();
    }

    private void Update()
    {
        if (slider != null)
        {
            ICommand command = invoker.ExcuteCommand();
            if (command != null)
            {
                command.Excute();
            }
        }
    }
}
